import { Avatar, Tag } from '@douyinfe/semi-ui';
import { ColumnProps } from '@douyinfe/semi-ui/lib/es/table';

const BaseColumns: ColumnProps[] = [
  {
    title: '角色编号',
    dataIndex: 'code',
  },
  {
    title: '角色名称',
    dataIndex: 'name',
    render: (cellContent) => {
      return (
        <div className='flex items-center'>
          <Avatar size='small' className='mr-2' alt='User'>
            {cellContent[0]}
          </Avatar>
          <span>{cellContent}</span>
        </div>
      );
    },
  },
  {
    title: '状态',
    dataIndex: 'status',
    render: (cellContent) => {
      return (
        <Tag color={cellContent === 1 ? 'red' : 'green'}>
          {cellContent === 1 ? '关闭' : '开启'}
        </Tag>
      );
    },
  },
  {
    title: '角色备注',
    dataIndex: 'remark',
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
  },
];

export default BaseColumns;
